import request from '@/utils/request'

export function getRuleList(params,type) {
    
    return request({
        url: `/pass/api/${type}/holidays/rule/list`,
        method: 'get',
        params
    })
}
export function saveRule(type, params,serviceType) {
  
   
    if (type == 'add') {
        return request({
            url: `/pass/api/${serviceType}/holidays/rule/add`,
            method: 'post',
            data: params,
            headers: {
                'content-type':'application/json'
            }
        })
    } else  {
        return request({
            url: `/pass/api/${serviceType}/holidays/rule/update`,
            method: 'put',
            data: params,
            headers: {
                'content-type':'application/json'
            }
        })
    }
    
}

export function getRuleDetail(number,type) {
    
    return request({
        url: `/pass/api/${type}/holidays/rule/detail`,
        method: 'get',
        params: {
            number:number
        }
    })
}

export function deleteRule(number,type) {
    
    return request({
        url: `/pass/api/${type}/holidays/rule/delete`,
        method: 'delete',
        params: {
            number:number
        }
    })
}